<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/21
 * Time: 22:20
 */
namespace App\Demo\Controllers;
use Intervention\Image\ImageManagerStatic as Image;

class ImgController extends BaseController
{
	public function upload()
	{
		$this->display();
	}

	public function uploadImg()
	{
		Image::configure(array('driver'=>'GD'));
		//$img = Image::make($_FILES['imageFile']['tmp_name']);

		//$img->fit(1600,1000);
		//$img->save('runtime/xxx10.jpg');

		$img = Image::make('runtime/small.jpg');
		$img->resize(400,400);
		$img->save('runtime/small.gif');
		$img->destroy();
		unlink('runtime/xxx10.jpg');	//删除文件，用php自带函数

	}
}